package cn.kattomy.shop.adminuser.dao.impl;

import java.util.List;

import cn.kattomy.shop.adminuser.dao.AdminUserDao;
import cn.kattomy.shop.adminuser.vo.AdminUser;
import cn.kattomy.shop.base.dao.BaseDao;

public class AdminUserDaoImpl extends BaseDao implements AdminUserDao{

	@Override
	public AdminUser login(AdminUser adminUser) {
		String hql = "from AdminUser where username = ? and password = ?";
		List<AdminUser> list = getSession().createQuery(hql)
				.setString(0, adminUser.getUsername()).setString(1, adminUser.getPassword()).list();
		if (list != null && list.size() > 0) {
			return list.get(0);
		}
		return null;
	}

}
